<?php
/**
 * Created by PhpStorm.
 * User: tangchao
 * Date: 19-4-19
 * Time: 下午3:37
 */

namespace Lib;

//注册器模式--在服务初始化时注册,业务层调用时直接取出即可
class Register
{
    protected static $objects;

    static function set($alias,$object){
        self::$objects[$alias] = $object;
    }

    static function get($alias){
        if (isset(self::$objects[$alias])){
            return self::$objects[$alias];
        }else{
            return null;
        }
    }

    static function _unset($alias){
        unset(self::$objects[$alias]);
    }
}